<div class="settings index">
<h2><?php __('Settings');?></h2>

<table class="index">
<tr>
	<th>Name</th>
	<th>Value</th>
	<th>Key</th>
</tr>
<?php
$i = 0;

foreach ($settings as $setting):
	$class = null;
	if ($i++ % 2 == 0) {
		$class = ' class="altrow"';
	}
?>
	<tr<?php echo $class;?>>
		<td>
			<?php echo $setting['Setting']['name']; ?>
		</td>
		<td>
			<?php echo $setting['Setting']['value']; ?>
		</td>
		<td>
			<?php echo $setting['Setting']['key']; ?>
		</td>
		<td class="actions">
			<?php echo $html->link(__('Edit', true), array('action'=>'edit', $setting['Setting']['key'])); ?>
			<?php echo $html->link(__('Delete', true), array('action'=>'delete', $setting['Setting']['key']), null, sprintf(__('Are you sure you want to delete # %s?', true), $setting['Setting']['key'])); ?>
		</td>
	</tr>
<?php endforeach; ?>
</table>
</div>

<div class="settings form">
<?php echo $form->create('Setting');?>
	<fieldset>
 		<legend><?php __('Add Setting');?></legend>
	<?php
		echo $form->input('key', array('type'=>'text'));
		echo $form->input('name');
		echo $form->input('value');
	?>
	<?php echo $form->end('Submit');?>
	</fieldset>
</div>

<div>
	<h3>Backup</h3>
	<?= $html->link('Backup your data >>', array('controller'=>'settings', 'action'=>'backup')) ?>
</div>

